/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package inquiry;

import java.sql.Date;
import javax.persistence.*;
import transactions.LateCharge;
import user.Customer;

/**
 *
 * @author Nacer Khalil
 */
@Entity
@Table(name="late_charge_inquiry")
//@Inheritance(strategy=InheritanceType.JOINED)
public class LateChargeInquiry extends Inquiry{
    
    @ManyToOne
    @JoinColumn(name = "cus_id")
    private Customer customer;
    
    @ManyToOne
    @JoinColumn(name = "ch_id")
    private LateCharge lateChange;

    public LateChargeInquiry() {
        super();
    }

    public LateChargeInquiry(String message, Date date, Customer customer, LateCharge lateChange) {
        super(message, date);
        this.customer = customer;
        this.lateChange = lateChange;
    }

    /**
     * @return the customer
     */
    public Customer getCustomer() {
        return customer;
    }

    /**
     * @return the lateChange
     */
    public LateCharge getLateChange() {
        return lateChange;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final LateChargeInquiry other = (LateChargeInquiry) obj;
        if (this.customer != other.customer && (this.customer == null || !this.customer.equals(other.customer))) {
            return false;
        }
        if (this.lateChange != other.lateChange && (this.lateChange == null || !this.lateChange.equals(other.lateChange))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        return hash;
    }
    
    
    
}
